package com.api.core.domain.query;

import com.alibaba.fastjson2.JSONArray;
import com.alibaba.fastjson2.JSONObject;
import lombok.Getter;
import lombok.Setter;
import org.apache.commons.lang3.StringUtils;

import java.util.List;

@Getter
@Setter
public class MonitoredLatestQuery {
    private String monitoredCode;
    private JSONObject monitoredNameLocales;
    private List<Integer> datColSet;
    private List data;

    public void setDatColSet(String datColSet) {
        if (StringUtils.isNotBlank(datColSet)) {
            this.datColSet = JSONArray.parseArray(datColSet).toList(Integer.class);
        }
    }

    public void setMonitoredNameLocales(String monitoredNameLocales) {
        this.monitoredNameLocales = JSONObject.parseObject(monitoredNameLocales);
    }
}
